<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

     <ui:composition template="/views/_template.xhtml">
        <ui:define name="corpo">
            <h:form>
                <h:messages style="color: red"/>
                <p:outputLabel style="text-align: right; margin-left: 720px; color: #99a699;" value="Total de registros: #{documentoBean.documentos.size()}" />
                <p:outputLabel value="Consulta documentos cadastrados" style="border-bottom: 3px solid #C22; text-align: left; font-size: 18px; width: 900px;" />
                <p:dataTable value="#{documentoBean.documentos}" var="documento" emptyMessage="Nenhum registro encontrado!">
                    <p:column style="width: 10px; text-align: left"  headerText="Número do Documento"  >
                        <h:outputText value="#{documento.nrDocumento}" />
                    </p:column>
                    <p:column style="width: 10px; text-align: left" headerText="Situação do Pagamento" >
                        <h:outputText value="#{documento.situacao}" />
                    </p:column>
                    <p:column style="width: 10px; text-align: left" headerText="Valor" >
                        <h:outputText value="#{documento.valor}"/>
                    </p:column>
                    <p:column style="width: 10px;" headerText="Alterar">
                        <center>
                            <h:commandLink action="#{documentoBean.alterar(documento)}">
                                <h:graphicImage library="imagens" name="edit-icon.gif" style="width: 30px; height: 20px;" />
                            </h:commandLink>
                        </center>
                    </p:column>
                    <p:column style="width: 10px;" headerText="Excluir">
                        <center>
                            <h:commandLink action="#{documentoBean.remover(documento)}">
                                <h:graphicImage library="imagens" name="icon_delete.gif" style="width: 30px; height: 20px;" /> 
                            </h:commandLink>
                        </center>
                    </p:column>
                </p:dataTable><br />
                <p:commandButton value="Novo" action="/operador/incluirDocumento"  ajax="false"/>
                <p:commandButton value="Voltar" action="/index" immediate="true" ajax="false"/>   
            </h:form>
        </ui:define>
    </ui:composition>
</html>

